<template>
	<view>
		<view class="user">
			<view class="" v-for="(item,index) in 10" :key="index">
				<view class="">
					用户名:{{item}}
				</view>
				<button @click="toTalk">去聊天</button>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		login
	} from '../../api/index.js'; //引入需要的api
	export default {
		name: "three",
		data() {
			return {
				userList:[]
			};
		},
		created() {
			console.log("会执行这里吗")
		},
		methods: {
			toTalk() {
				uni.navigateTo({
					url:"/pages/talk/talk"
				});
			},
			getUser() {
				login({
					action: 'get'
				}).then(data => {
					console.log(data);
					if(data.code==200){
						this.userList=data.data.data
					}
				});
			}
		}
	}
</script>

<style>
	.parent {
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		border: 1rpx solid #ccc;
	}
</style>
